3.2.37 \(\int x (a+b \tanh ^{-1}(\frac {c}{x})) \, dx\) [137]

Optimal. Leaf size=39 \[ \frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right ) \]

[Out]

1/2*b*c*x+1/2*x^2*(a+b*arctanh(c/x))-1/2*b*c^2*arctanh(x/c)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6037, 199, 327, 213} \begin {gather*} \frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right )+\frac {b c x}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(a + b*ArcTanh[c/x]),x]

[Out]

(b*c*x)/2 + (x^2*(a + b*ArcTanh[c/x]))/2 - (b*c^2*ArcTanh[x/c])/2

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b}, x] && LtQ[n, 0]
 && IntegerQ[p]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 6037

Int[((a_.) + ArcTanh[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTanh[c*
x^n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTanh[c*x^n])^(p - 1)/(1 - c^2*x^(2*n))
), x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1
]

Rubi steps

\begin {align*} \int x \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right ) \, dx &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} (b c) \int \frac {1}{1-\frac {c^2}{x^2}} \, dx\\ &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} (b c) \int \frac {x^2}{-c^2+x^2} \, dx\\ &=\frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} \left (b c^3\right ) \int \frac {1}{-c^2+x^2} \, dx\\ &=\frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 56, normalized size = 1.44 \begin {gather*} \frac {b c x}{2}+\frac {a x^2}{2}+\frac {1}{2} b x^2 \tanh ^{-1}\left (\frac {c}{x}\right )+\frac {1}{4} b c^2 \log (-c+x)-\frac {1}{4} b c^2 \log (c+x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*ArcTanh[c/x]),x]

[Out]

(b*c*x)/2 + (a*x^2)/2 + (b*x^2*ArcTanh[c/x])/2 + (b*c^2*Log[-c + x])/4 - (b*c^2*Log[c + x])/4

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 60, normalized size = 1.54

method result size
derivativedivides \(-c^{2} \left (-\frac {a \,x^{2}}{2 c^{2}}-\frac {b \,x^{2} \arctanh \left (\frac {c}{x}\right )}{2 c^{2}}+\frac {b \ln \left (1+\frac {c}{x}\right )}{4}-\frac {b \ln \left (\frac {c}{x}-1\right )}{4}-\frac {b x}{2 c}\right )\) \(60\)
default \(-c^{2} \left (-\frac {a \,x^{2}}{2 c^{2}}-\frac {b \,x^{2} \arctanh \left (\frac {c}{x}\right )}{2 c^{2}}+\frac {b \ln \left (1+\frac {c}{x}\right )}{4}-\frac {b \ln \left (\frac {c}{x}-1\right )}{4}-\frac {b x}{2 c}\right )\) \(60\)
risch \(\frac {b \,x^{2} \ln \left (x +c \right )}{4}-\frac {b \,x^{2} \ln \left (c -x \right )}{4}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{3}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2}}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{3}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{4}-\frac {i \pi b \,x^{2}}{4}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{8}+\frac {a \,x^{2}}{2}+\frac {b c x}{2}+\frac {b \,c^{2} \ln \left (x -c \right )}{4}-\frac {b \,c^{2} \ln \left (x +c \right )}{4}\) \(311\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*arctanh(c/x)),x,method=_RETURNVERBOSE)

[Out]

-c^2*(-1/2*a/c^2*x^2-1/2*b/c^2*x^2*arctanh(c/x)+1/4*b*ln(1+c/x)-1/4*b*ln(c/x-1)-1/2*b*x/c)

________________________________________________________________________________________

Maxima [A]
time = 0.25, size = 44, normalized size = 1.13 \begin {gather*} \frac {1}{2} \, a x^{2} + \frac {1}{4} \, {\left (2 \, x^{2} \operatorname {artanh}\left (\frac {c}{x}\right ) - {\left (c \log \left (c + x\right ) - c \log \left (-c + x\right ) - 2 \, x\right )} c\right )} b \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c/x)),x, algorithm="maxima")

[Out]

1/2*a*x^2 + 1/4*(2*x^2*arctanh(c/x) - (c*log(c + x) - c*log(-c + x) - 2*x)*c)*b

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 39, normalized size = 1.00 \begin {gather*} \frac {1}{2} \, b c x + \frac {1}{2} \, a x^{2} - \frac {1}{4} \, {\left (b c^{2} - b x^{2}\right )} \log \left (-\frac {c + x}{c - x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c/x)),x, algorithm="fricas")

[Out]

1/2*b*c*x + 1/2*a*x^2 - 1/4*(b*c^2 - b*x^2)*log(-(c + x)/(c - x))

________________________________________________________________________________________

Sympy [A]
time = 0.12, size = 36, normalized size = 0.92 \begin {gather*} \frac {a x^{2}}{2} - \frac {b c^{2} \operatorname {atanh}{\left (\frac {c}{x} \right )}}{2} + \frac {b c x}{2} + \frac {b x^{2} \operatorname {atanh}{\left (\frac {c}{x} \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*atanh(c/x)),x)

[Out]

a*x**2/2 - b*c**2*atanh(c/x)/2 + b*c*x/2 + b*x**2*atanh(c/x)/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 130 vs. \(2 (33) = 66\).
time = 0.40, size = 130, normalized size = 3.33 \begin {gather*} -\frac {\frac {b {\left (c + x\right )} c^{3} \log \left (-\frac {c + x}{c - x}\right )}{{\left (c - x\right )} {\left (\frac {{\left (c + x\right )}^{2}}{{\left (c - x\right )}^{2}} + \frac {2 \, {\left (c + x\right )}}{c - x} + 1\right )}} + \frac {b c^{3} + \frac {2 \, a {\left (c + x\right )} c^{3}}{c - x} + \frac {b {\left (c + x\right )} c^{3}}{c - x}}{\frac {{\left (c + x\right )}^{2}}{{\left (c - x\right )}^{2}} + \frac {2 \, {\left (c + x\right )}}{c - x} + 1}}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c/x)),x, algorithm="giac")

[Out]

-(b*(c + x)*c^3*log(-(c + x)/(c - x))/((c - x)*((c + x)^2/(c - x)^2 + 2*(c + x)/(c - x) + 1)) + (b*c^3 + 2*a*(
c + x)*c^3/(c - x) + b*(c + x)*c^3/(c - x))/((c + x)^2/(c - x)^2 + 2*(c + x)/(c - x) + 1))/c

________________________________________________________________________________________

Mupad [B]
time = 0.74, size = 36, normalized size = 0.92 \begin {gather*} \frac {a\,x^2}{2}-\frac {b\,c^2\,\mathrm {atanh}\left (\frac {c}{x}\right )}{2}+\frac {b\,x^2\,\mathrm {atanh}\left (\frac {c}{x}\right )}{2}+\frac {b\,c\,x}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*atanh(c/x)),x)

[Out]

(a*x^2)/2 - (b*c^2*atanh(c/x))/2 + (b*x^2*atanh(c/x))/2 + (b*c*x)/2

________________________________________________________________________________________